<!-- 父子通信 -->
<!-- 父传子通过props -->
<!-- 子传父通过$emit事件 -->
<!-- 下面代码直接将Vue实例当做父组件,并且其中包含子组件来简化代码 -->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			<!-- 因为html标签不区分大小写,所以其为c-info -->
			<cpn :c-info="message"></cpn>
		</div>
	</body>
	
	<template id="cpn">
		<h2>{{cInfo}}</h2>
	</template>
	
	<script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
	
	<script type="text/javascript">
		const cpn = {
			template : '#cpn',
			props:["cInfo"]
		}	
		
		const app = new Vue({
			el : "#app",
			data:{
				message: "hello",
				movies:[
					"海王",
					"海贼王",
					"天空之城"
				]
			},
			components:{
				cpn
			}
		})
	</script>
</html>